
// 通过这个方法,递归,生成用户的路由
const recursionRoutes = (menuList, routes) => {
    // console.log('menulist', menuList)
    // console.log('routes', routes)
    let userMenu = []//存储计算结果
    menuList.forEach(menu => {
        routes.forEach(route => {
            if(menu.title === route.meta.title){
                //递归
                if (menu.children && menu.children.length){
                    route.children = recursionRoutes(menu.children, route.children)
                }
                userMenu.push(route)
            }
        })
        
    });
    return userMenu

}


export default recursionRoutes